package com.copy.pojo;

import com.copy.mark.CloneType;
import com.copy.parse.transform.TypeTransform;

public class Property {
    private String targetPropertyName;
    private String resorcePropertyName;
    private Class<TypeTransform> typeTransform;
    private CloneType cloneType;
    //是否启动BigDecimal解析
    private boolean isBigDecimal=false;
    //强制转换
    private boolean openForceCast=false;

    public boolean isOpenForceCast() {
        return openForceCast;
    }

    public void setOpenForceCast(boolean openForceCast) {
        this.openForceCast = openForceCast;
    }

    public boolean isBigDecimal() {
        return isBigDecimal;
    }

    public void setBigDecimal(boolean bigDecimal) {
        isBigDecimal = bigDecimal;
    }

    public Property(String targetPropertyName, String resorcePropertyName) {
        this.targetPropertyName = targetPropertyName;
        this.resorcePropertyName = resorcePropertyName;
    }

/*    public static class Builder{
        //必要字段
        private String targetPropertyName;
        private String resorcePropertyName;

        private Class<TypeTransform> typeTransform;
        private CloneType cloneType;
        public Builder (String targetPropertyName,String resorcePropertyName){
            this.resorcePropertyName=resorcePropertyName;
            this.targetPropertyName=targetPropertyName;
        }
        public Builder typeTransform(Class<TypeTransform> typeTransform){
            this.typeTransform=typeTransform;
            return this;
        }
        public Builder cloneType(CloneType cloneType){
            this.cloneType=cloneType;
            return  this;
        }
        public Property getProperty(){
            return  new Property(this);
        }
    }
    private Property(Builder builder){
        this.resorcePropertyName=builder.resorcePropertyName;
        this.targetPropertyName=builder.targetPropertyName;
        this.cloneType=builder.cloneType;
        this.typeTransform=builder.typeTransform;
    }*/

    public String getTargetPropertyName() {
        return targetPropertyName;
    }


    public String getResorcePropertyName() {
        return resorcePropertyName;
    }


    public Class<TypeTransform> getTypeTransform() {
        return typeTransform;
    }

    public void setTypeTransform(Class<TypeTransform> typeTransform) {
        this.typeTransform = typeTransform;
    }

    public CloneType getCloneType() {
        return cloneType;
    }

    public void setCloneType(CloneType cloneType) {
        this.cloneType = cloneType;
    }
}
